package com.xiashitech.apiservice.util;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
public class RabbitMqUtil {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String name){
        String context = "hello " + new Date();
        System.out.println("Sender : " + context);
        this.rabbitTemplate.convertAndSend("hello", context);
    }
}
